﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Smart
{
    public class DbMenu : Tablo
    {
        public int MenuNo { get; set; }
        public int Kullanilabilir { get; set; }
        public string MenuAdi { get; set; }
        public int Sifreli { get; set; }

        public DbMenu()
        {
            this.TabloAdi = "TBL_MENU";
        }

        public override IEnumerable<string> BulkImport(int kullaniciId)
        {
            yield return "İndiriliyor...";
            string[] dt = BackOffice.Get.MenuList(kullaniciId);
            yield return "indirildi.";
            if (dt != null)
            {
                SqlCeClient.Get.Exec("delete from TBL_MENU");
            }
            foreach (string item in SqlCeClient.Get.importRows(this.TabloAdi, dt))
            {
                yield return item;
            }
            yield return "Tamamlandı";
        }
    }
}
